<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        //求出1000-9999之间的 4 叶玫瑰数
        for (j = 1000; j <= 9999; j++) {
            var g = j % 10;
            var s = parseInt(j % 100 / 10);
            var b = parseInt(j % 1000 / 100);
            var q = parseInt(j / 1000);
            if (g * g * g * g + s * s * s * s + b * b * b * b + q * q * q * q === j) {
                console.log(j + '是4 叶玫瑰数')
            }
        }
    </script>
</body>

</html>